/*
 * Albareth - an action roleplaying game.
 * Copyright (C) 2008 Jens Anuth
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 *   02110-1301, USA.
 * 
 * $Id: PlayerCharStatusFrame.java 38 2008-05-07 20:00:46Z jens464 $
*/
package albareth.frontend.slick.ui;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;

import albareth.core.entity.PlayerCharacter;
import albareth.frontend.slick.SlickFrontend;
import albareth.frontend.slick.state.InGameState;

//TODO: include buff frame
public class PlayerCharStatusFrame extends UIElement
{
    //private Font _font = SlickResources.GAME_FONT;
    //private int _lineHeight = _font.getLineHeight();
    
    PlayerCharacter _player;

    
    public PlayerCharStatusFrame(PlayerCharacter player)
    {
        _player = player;
        setId(InGameState.COMP_STATUS);
        setForegroundColor(SlickFrontend.DEFAULT_TEXT_COLOR);
    }

    public void render(Graphics g, GameContainer container, int screenX, int screenY)
            throws SlickException
    {
        //g.setFont(_font);
        //g.setColor(COLOR_DISPLAY);
        
        g.drawString(_player.getName().toUpperCase(), screenX, screenY);
        
        float top = screenY + 30;
        int lineHeight = getFont().getLineHeight();
        g.drawString("ARMOR:", screenX, top);
        g.drawString("GOLD: " + String.valueOf(_player.getGold()), screenX, top + lineHeight);
        //g.drawString("STR: " + _player.getStr(), screenX, top);
        //g.drawString("DEX: " + _player.getDex(), screenX, top + lineHeight);
        //g.drawString("INT: " + _player.getInt(), screenX, top + lineHeight*2);
        g.drawString("LIFE: " +
                     _player.getHitpoints() + "/" + _player.getMaxHitpoints(),
                     screenX, top + lineHeight*3);
        g.drawString("MANA: " +
                _player.getMana() + "/" + _player.getMaxMana(),
                screenX, top + lineHeight*4);
        g.drawString("XP: " +
                _player.getExperience() + "/" + _player.getExperienceForNextLevel(),
                screenX, top + lineHeight*5);
        g.drawString("LVL: " + _player.getLevel(), screenX, top + lineHeight*6);

    }

}
